<%-- 
    Document   : ResistenciaEletrica
    Created on : 16/12/2011, 14:41:24
    Author     : THYAGO
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Conversor Resistencia Eletrica</title>
    </head>
    <body>
      <ul class="navbar">
            <li><a href="javascript:window.history.go(-1)">Voltar</a>
            <li><a href="/conversorMedidas/"> Home Page </a>
            <li><a href="equipe.jsp">Quem somos?</a>
            <li><a href="volume.jsp">Volume</a>
            <li><a href="moeda.jsp">Moeda</a>
            <li><a href="Potencia.jsp">Potência</a>
            <li><a href="ConverterPrincipal.jsp">Velocidade</a>
            <li><a href="ResistenciaEletrica.jsp">ResistenciaEletrica</a>
        </ul>
       <form name="Entrada" action="">
            <br><BR>
            Converter: <input type="text" name="entrada" value=<%=request.getParameter("entrada")%> />
            <select name="ResistenciaEletrica">
                <option>Ohm</option>
                <option>Abohm</option>
                <option>Megaohm</option>
                <option>Nanoohm</option>
                <option>Gigaohm</option>
                <option>Kiloohm</option>
                <option>Miliohm</option>
                <option>MicroOhm</option>
                <option>Volt Amp</option>
                    </select>
            <input type="submit" value="Converter" name="bot" />
        </form>

             <%  try {
                        if (request.getParameter("ResistenciaEletrica") != null && request.getParameter("entrada") != null) {
                            if (request.getParameter("ResistenciaEletrica").equals("Ohm")) {
                                Double valor = Double.parseDouble(request.getParameter("entrada"));
                                Double r = valor * 1;
        %>
        <br>
        <br>
        <h1>Converter Ohm para..</h1>
        <h2>Ohm <%=r%></h2>
        <% r = valor * 1;%>
        <h2>Abohm <%=r%></h2>
        <% r = valor *1000000000;%>
        <h2>Megaohm <%=r%></h2>
        <%r = valor *1.0E-6;%>
        <h2>Nanoohm <%=r%></h2>
        <%r = valor *1000000000;%>
        <h2>Gigaohm: <%=r%></h2>
        <%r = valor *1.0E-9;%>
        <h2>Kiloohm <%=r%></h2>
        <%r = valor *0.001;%>
        <h2>Miliohm <%=r%></h2>
        <%r = valor *1000;%>
        <h2>MicroOhm <%=r%></h2>
        <%r = valor *1000000;%>
        <h2>Volt Amp <%=r%></h2>
        <%r= valor *1;%>
          <%
              } else if (request.getParameter("ResistenciaEletrica").equals("Abohm")) {
                                        Double valor = Double.parseDouble(request.getParameter("entrada"));
                                        Double r = valor * 1;
        %>
        <br>
        <br>
        <h1>Converter Abohm para..</h1>
        <h2>Abohm <%=r%></h2>
        <% r = valor * 1;%>
        <h2>Ohm <%=r%></h2>
        <% r = valor *1.0E-9;%>
        <h2>Megaohm <%=r%></h2>
        <%r = valor *1.0E-15;%>
        <h2>Nanoohm <%=r%></h2>
        <%r = valor *1;%>
        <h2>Gigaohm: <%=r%></h2>
        <%r = valor *1.0E-18;%>
        <h2>Kiloohm <%=r%></h2>
        <%r = valor *1.0E-12;%>
        <h2>Miliohm <%=r%></h2>
        <%r = valor *1.0E-6;%>
        <h2>MicroOhm <%=r%></h2>
        <%r = valor *0.001;%>
        <h2>Volt Amp <%=r%></h2>
        <%r= valor *1.0E-9;%>
            <%
              } else if (request.getParameter("ResistenciaEletrica").equals("Megaohm")) {
                                        Double valor = Double.parseDouble(request.getParameter("entrada"));
                                        Double r = valor * 1;
        %>
        <br>
        <br>
        <h1>Converter Megaohm para..</h1>
        <h2>Megaohm <%=r%></h2>
        <% r = valor * 1;%>
        <h2>Ohm <%=r%></h2>
        <% r = valor *1000000;%>
        <h2>Abohm <%=r%></h2>
        <%r = valor *1.0E+15;%>
        <h2>Nanoohm <%=r%></h2>
        <%r = valor *1.0E+15;%>
        <h2>Gigaohm: <%=r%></h2>
        <%r = valor *0.001;%>
        <h2>Kiloohm <%=r%></h2>
        <%r = valor /1000;%>
        <h2>Miliohm <%=r%></h2>
        <%r = valor *1000000000;%>
        <h2>MicroOhm <%=r%></h2>
        <%r = valor *1.0E+12;%>
        <h2>Volt Amp <%=r%></h2>
        <%r= valor *1000000;%>
            <%
              } else if (request.getParameter("ResistenciaEletrica").equals("Nanoohm")) {
                                        Double valor = Double.parseDouble(request.getParameter("entrada"));
                                        Double r = valor * 1;
        %>
        <br>
        <br>
        <h1>Converter Nanoohm para..</h1>
        <h2>Nanoohm <%=r%></h2>
        <% r = valor * 1;%>
        <h2>Ohm <%=r%></h2>
        <% r = valor *1.0E-9;%>
        <h2>Abohm <%=r%></h2>
        <%r = valor *1;%>
        <h2>Megaohm <%=r%></h2>
        <%r = valor *1.0E-15;%>
        <h2>Gigaohm: <%=r%></h2>
        <%r = valor *1.0E-18;%>
        <h2>Kiloohm <%=r%></h2>
        <%r = valor /1.0E+12;%>
        <h2>Miliohm <%=r%></h2>
        <%r = valor *1.0E-6;%>
        <h2>MicroOhm <%=r%></h2>
        <%r = valor *0.001;%>
        <h2>Volt Amp <%=r%></h2>
        <%r= valor *1.0E-9;%>
            <%
              } else if (request.getParameter("ResistenciaEletrica").equals("Gigaohm")) {
                                        Double valor = Double.parseDouble(request.getParameter("entrada"));
                                        Double r = valor * 1;
        %>
        <br>
        <br>
        <h1>Converter Gigaohm para..</h1>
        <h2>Gigaohm <%=r%></h2>
        <% r = valor * 1;%>
        <h2>Ohm <%=r%></h2>
        <% r = valor *1000000000;%>
        <h2>Abohm <%=r%></h2>
        <%r = valor *1.0E+18;%>
        <h2>Megaohm <%=r%></h2>
        <%r = valor *1000;%>
        <h2>Nanoohm <%=r%></h2>
        <%r = valor *1.0E+18;%>
        <h2>Kiloohm <%=r%></h2>
        <%r = valor *1000000;%>
        <h2>Miliohm <%=r%></h2>
        <%r = valor *1.0E+12;%>
        <h2>MicroOhm <%=r%></h2>
        <%r = valor *1.0E+15;%>
        <h2>Volt Amp <%=r%></h2>
        <%r= valor *1000000000;%>
            <%
              } else if (request.getParameter("ResistenciaEletrica").equals("Kiloohm")) {
                                        Double valor = Double.parseDouble(request.getParameter("entrada"));
                                        Double r = valor * 1;
        %>
        <br>
        <br>
        <h1>Converter Kiloohm para..</h1>
        <h2>Kiloohm <%=r%></h2>
        <% r = valor * 1;%>
        <h2>Ohm <%=r%></h2>
        <% r = valor *1000;%>
        <h2>Abohm <%=r%></h2>
        <%r = valor *1.0E+12;%>
        <h2>Megaohm <%=r%></h2>
        <%r = valor *0.001;%>
        <h2>Nanoohm <%=r%></h2>
        <%r = valor *1.0E+12;%>
        <h2>Gigaohm <%=r%></h2>
        <%r = valor *1.0E-6;%>
        <h2>Miliohm <%=r%></h2>
        <%r = valor *1000000;%>
        <h2>MicroOhm <%=r%></h2>
        <%r = valor *1000000000;%>
        <h2>Volt Amp <%=r%></h2>
        <%r= valor /1000;%>
            <%
              } else if (request.getParameter("ResistenciaEletrica").equals("Miliohm")) {
                                        Double valor = Double.parseDouble(request.getParameter("entrada"));
                                        Double r = valor * 1;
        %>
        <br>
        <br>
        <h1>Converter Miliohm para..</h1>
        <h2>Miliohm <%=r%></h2>
        <% r = valor * 1;%>
        <h2>Ohm <%=r%></h2>
        <% r = valor *0.001;%>
        <h2>Abohm <%=r%></h2>
        <%r = valor *1000000;%>
        <h2>Megaohm <%=r%></h2>
        <%r = valor *1.0E-9;%>
        <h2>Nanoohm <%=r%></h2>
        <%r = valor *1000000;%>
        <h2>Gigaohm <%=r%></h2>
        <%r = valor *1.0E-12;%>
        <h2>Kiloohm <%=r%></h2>
        <%r = valor *1.0E-6;%>
        <h2>MicroOhm <%=r%></h2>
        <%r = valor *1000;%>
        <h2>Volt Amp <%=r%></h2>
        <%r= valor *0.001;%>
            <%
              } else if (request.getParameter("ResistenciaEletrica").equals("MicroOhm")) {
                                        Double valor = Double.parseDouble(request.getParameter("entrada"));
                                        Double r = valor * 1;
        %>
        <br>
        <br>
        <h1>Converter MicroOhm para..</h1>
        <h2>MicroOhm <%=r%></h2>
        <% r = valor * 1;%>
        <h2>Ohm <%=r%></h2>
        <% r = valor *1.0E-6;%>
        <h2>Abohm <%=r%></h2>
        <%r = valor *1000;%>
        <h2>Megaohm <%=r%></h2>
        <%r = valor *1.0E-12;%>
        <h2>Nanoohm <%=r%></h2>
        <%r = valor *1000;%>
        <h2>Gigaohm <%=r%></h2>
        <%r = valor *1.0E-15;%>
        <h2>Kiloohm <%=r%></h2>
        <%r = valor *1.0E-9;%>
        <h2>Miliohm <%=r%></h2>
        <%r = valor *0.001;%>
        <h2>Volt Amp <%=r%></h2>
        <%r= valor *1.0E-6;%>
            <%
              } else if (request.getParameter("ResistenciaEletrica").equals("Volt Amp")) {
                                        Double valor = Double.parseDouble(request.getParameter("entrada"));
                                        Double r = valor * 1;
        %>
        <br>
        <br>
        <h1>Converter Volt Amp para..</h1>
        <h2>Volt Amp <%=r%></h2>
        <% r = valor * 1;%>
        <h2>Ohm <%=r%></h2>
        <% r = valor *1;%>
        <h2>Abohm <%=r%></h2>
        <%r = valor *1000000000;%>
        <h2>Megaohm <%=r%></h2>
        <%r = valor *1.0E-6;%>
        <h2>Nanoohm <%=r%></h2>
        <%r = valor *1000000000;%>
        <h2>Gigaohm <%=r%></h2>
        <%r = valor *1.0E-9;%>
        <h2>Kiloohm <%=r%></h2>
        <%r = valor *0.001;%>
        <h2>Miliohm <%=r%></h2>
        <%r = valor *1000;%>
        <h2>MicroOhm <%=r%></h2>
        <%r= valor *1000000;%>
        <% }
              }
          } catch (Exception e) {%><br><br><h1>Por favor, informar o valor correto!</h1><%                      }
        %></body>
</html>
